package com.dfiov.cloud.msmtools.service.feign;

import com.alibaba.fastjson.JSON;
import com.dfiov.cloud.msmtools.mapper.entity.msdevice.DeviceVehicle;
import com.dfiov.cloud.msmtools.mapper.entity.msdevice.SeriesDetailResp;
import com.dfiov.cloud.msmtools.mapper.entity.msdevice.VehicleInfoRes;
import com.dfiov.cloud.msmtools.mapper.entity.msdevice.VehicleWithSimResp;
import com.pateo.qingcloud.base.auth.common.session.AuthSession;
import com.pateo.qingcloud.framework.common.base.BaseRestResponse;
import com.pateo.qingcloud.framework.common.statusCode.CommonStatusCode;
import com.pateo.qingcloud.gateway.common.util.GatewayUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.beans.BeanUtils;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.Date;
import java.util.List;
import java.util.Objects;

//@FeignClient(value = "msdevice")
@FeignClient(name = "msdevice",url = "http://msdevice.pro.dftccloud.t.home")
public interface MsDeviceFeignClient {

    @RequestMapping(value = "/device/vehicle/findVehicleWithSim", method = RequestMethod.GET)
    BaseRestResponse<VehicleWithSimResp> findVehicleWithSimByVin(@RequestParam(value = "vin") String vin);


    @RequestMapping(value = "/device/vehicle/queryVehicleDetail", method = RequestMethod.GET)
    BaseRestResponse<VehicleInfoRes> queryVehicleDetail(HttpServletRequest request, @RequestParam(value = "vin") String vin) ;

    @RequestMapping(value = "/device/vehicle/getDeviceVehicle/{vin}", method = RequestMethod.GET)
    DeviceVehicle getDeviceVehicle(@PathVariable(value = "vin") String vin) ;

    @GetMapping("/device/vehicle/series/findSeriesByCode")
    BaseRestResponse<SeriesDetailResp> findSeriesByCode(@RequestParam("seriesCode") String seriesCode);


}
